<template>
  <!-- 明细页面弹出框-->
  <el-dialog
    title="参与机构状态变更通知报文查询明细"
    center
    :visible.sync="open"
    width="1024px"
    :close-on-click-modal="true"
    @close="closeFn"
  >
    <el-form ref="detailsForm" :model="formData" label-width="150px" :disabled="true">
      <el-row type="flex">
        <el-col :span="12">
          <el-form-item label="交易流水号：" prop="id">
            <el-input v-model="formData.id" placeholder="" />
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex">
        <el-col :span="12">
          <el-form-item label="工作日期：" prop="workdate">
            <el-date-picker
              v-model="formData.workdate"
              type="date"
              value-format="yyyyMMdd"
              placeholder=""
              style="width: 100%"
            ></el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="CPG日期：" prop="vdate">
            <el-date-picker
              v-model="formData.vdate"
              type="date"
              value-format="yyyyMMdd"
              placeholder=""
              style="width: 100%"
            ></el-date-picker>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex">
        <el-col :span="12">
          <el-form-item label="状态变更类型：" prop="stautsChgType">
            <el-select v-model="formData.stautsChgType" placeholder="" style="width: 100%">
              <el-option
                v-for="dict in dictMap.STATUS_CHG_TYPE"
                :key="dict.value"
                :label="`${dict.value}-${dict.text}`"
                :value="dict.value"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="参与机构类型：" prop="orgType">
            <el-select v-model="formData.orgType" placeholder="" style="width: 100%">
              <el-option
                v-for="dict in dictMap.PARTY_TYPE"
                :key="dict.value"
                :label="`${dict.value}-${dict.text}`"
                :value="dict.value"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex">
        <el-col :span="12">
          <el-form-item label="变更节点号：" prop="chgNode">
            <el-input v-model="formData.chgNode" placeholder="" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="报文接收时间：" prop="rcvTime">
            <el-date-picker
              v-model="formData.rcvTime"
              type="datetime"
              value-format="yyyyMMddHHmmss"
              placeholder=""
              style="width: 100%"
            ></el-date-picker>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex">
        <el-col :span="12">
          <el-form-item label="发起方：" prop="directSender">
            <el-input v-model="formData.directSender" placeholder="" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="发起方名称：" prop="directSenderName">
            <el-input v-model="formData.directSenderName" placeholder="" />
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex">
        <el-col :span="24">
          <el-form-item label="备注：" prop="remarks">
            <el-input type="textarea" v-model="formData.remarks" />
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <ht-table
      ref="dataTable"
      :showSerialNumber="false"
      :multi-select="false"
      :dictMap="dictMap"
      :reqConfig="reqConfig"
      :queryParams="queryParams"
      :tableBindColumns="tableBindColumns"
      defaultEventKey="detailsTable"
      style="height: 240px"
    ></ht-table>
    <el-form ref="detailsForm" :model="formData" label-width="126px" :disabled="true">
      <el-row type="flex">
        <el-col :span="12">
          <el-form-item label="补发标志：" prop="resndFlag">
            <el-select v-model="formData.resndFlag" placeholder="" style="width: 100%">
              <el-option
                v-for="dict in dictMap.RESND_FLAG_CODE"
                :key="dict.value"
                :label="`${dict.value}-${dict.text}`"
                :value="dict.value"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="通讯状态：" prop="status">
            <el-select v-model="formData.status" placeholder="" style="width: 100%">
              <el-option
                v-for="dict in dictMap.PKG_STATUS"
                :key="dict.value"
                :label="`${dict.value}-${dict.text}`"
                :value="dict.value"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex">
        <el-col :span="12">
          <el-form-item label="交易记录时间：" prop="txTime">
            <el-date-picker
              v-model="formData.txTime"
              type="datetime"
              value-format="yyyyMMddHHmmss"
              placeholder=""
              style="width: 100%"
            ></el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="最后状态变更时间：" prop="statTime">
            <el-date-picker
              v-model="formData.statTime"
              type="datetime"
              value-format="yyyyMMddHHmmss"
              placeholder=""
              style="width: 100%"
            ></el-date-picker>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button @click="closeFn">关闭</el-button>
    </div>
  </el-dialog>
</template>
<script>
import { detailsApiUrlConfig } from "@/api/cnaps/ccms/805/organization_status_change_notice.js";

export default {
  name: "organizationStatusDetails",
  components: {},
  props: {
    dictMap: {
      type: Object,
      default: () => {
        return {};
      },
    },
    formData: {
      type: Object,
      default: () => {
        return {};
      },
    },
    id: {
      type: String,
      default: "",
    },
  },
  data() {
    return {
      reqConfig: detailsApiUrlConfig,
      // 查询参数
      queryParams: {
        id: "",
      },
      tableBindColumns: [
        {
          label: `辖属参与机构`,
          prop: "chgDirectOrg",
          width: "500",
          align: "center",
        },
        {
          label: `辖属参与机构名称`,
          prop: "chgDirectOrgName",
          width: "500",
          align: "center",
        },
      ],
      // 是否显示弹出层
      open: false,
    };
  },
  mounted() {},
  watch: {
    open(d) {
      if (d) {
        this.$nextTick(() => {
          this.$set(this.queryParams, "id", this.id);
          this.$refs.dataTable.doQuery();
        });
      }
    },
  },
  methods: {
    // 表单重置
    reset() {
      this.resetForm("logForm");
    },
    closeFn() {
      this.open = false;
    },
    show() {
      this.open = true;
    },
    cancel() {
      this.open = false;
      this.reset();
    },
  },
};
</script>
